package com.cloud.consumer.mq;

import com.cloud.consumer.service.ReceiveService;
import javafx.scene.control.Skin;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.cloud.stream.messaging.Sink;
import org.springframework.context.annotation.Configuration;

import java.time.LocalDateTime;

/**
 * Sink接口方式绑定通道(比注解更简化)
 */
@Configuration
@EnableBinding(value = {ReceiveService.class, Sink.class})
public class SinkConfig {


    //这里的value若是input，可直接使用Sink.INPUT代替
    @StreamListener("myInput")
    public void receive(byte[] msg){
        System.out.println(LocalDateTime.now()+" groupB3 --------- Sink receive msg： " +new String(msg));
    }

}
